/* 
 * File:   GlobalData.h
 * Author: faraj
 *
 * Created on October 4, 2009, 7:45 AM
 */

#include "COMMANDS.h"
#include "FileList.h"
#include "ClientList.h"

#ifndef _GLOBALDATA_H
#define	_GLOBALDATA_H

#define CONTROL_PORT 9000
#define FT_PORT 9001

static string getVersion()
{
    string version 
            =  "\n___________________________________________________________________\n\n";
    version += "BunChi File Server Version 1.0\n";
    version += "___________________________________________________________________\n\n";
    version += "Developed by Faraj Farook\n";
    version += " email : farajfarook@gmail.com\n";
    version += " blog  : farajonline.blogspot.com\n\n";
    version += "thanks to : \n";
    version += "   - Benjamin Gr�delbach (RSA Data Security, Inc.) - MD5 library \n";
    version += "   - http://www.oopweb.com - Sting Tokenizer \n";
    version += "   - Chris Thompson & Richard Szalay - Link List Class \n";
    version += "   - Unix Network Programming by W.Richard Stevens \n";
    version += "   - World Wide Web, forums, blogs etc..\n";
    version += "___________________________________________________________________\n";
    return version;
}

static string getHelpCommand()
{
    string helpcom 
            =  "\n___________________________________________________________________\n\n";
    helpcom += "  HELP FILE \n";
    helpcom += "___________________________________________________________________\n\n  ";
    helpcom += COMMAND_HELP;
    helpcom += " \t- to get help \n  ";
    helpcom += COMMAND_QUIT;
    helpcom += " \t- to quit \n  ";
    helpcom += COMMAND_VERSION;
    helpcom += " \t- to get the server version \n  ";
    helpcom += COMMAND_GET_FILE;
    helpcom += " \t- to get the file \t arguments : <hash key>\n  ";
    helpcom += COMMAND_PUT_FILE;
    helpcom += " \t- to put the file  \t arguments : <filepath>\n  ";
    helpcom += COMMAND_DEL;
    helpcom += " \t- to delete the file \t arguments : <hash skey>\n";
    helpcom += "___________________________________________________________________\n ";
    return helpcom;
}

static ClientList clientList;
static pthread_mutex_t mutex_clientList;
static FileList fileList;
static pthread_mutex_t mutex_fileList;

#endif	/* _GLOBALDATA_H */

